1. Field of the Invention
This invention generally relates to the field of automatic memory management, and more particularly relates to a system and method for reducing write barrier overhead.
2. Description of Related Art
The popularity of object-oriented programming languages, such as the Java Programming Language, has rekindled a great deal of interest in automatic memory management. Java does not provide the programmer with an explicit mechanism to deallocate objects, and requires the underlying Java Virtual Machines (JVM) to support garbage collection. Researchers have developed a large number of garbage collection algorithms over the last four decades.
One of the popular approaches to garbage collection is known as generational garbage collection. It is inspired by an observation, known as the weak generational hypothesis, that most objects die young. A simple generational scheme involves partitioning the heap space into two regions—a nursery (or new generation) and an old generation. All new objects are allocated in the nursery. Most collections, termed minor collections, only reclaim garbage from the nursery. Survivors from a minor collection are promoted to the older generation, which is subjected to collection only during infrequent, major collections. In order to support a generational collection, the compiler has to insert a write barrier for each statement that writes into a pointer field of an object, to keep track of all pointers from objects in the old generation to objects in the nursery. These source objects in the old generation are added, as roots for minor collection, so that objects in the nursery that are reachable from those objects are not mistakenly collected. Compared with their non-generational counterparts, generational collectors typically have short pauses, due to the need to look at a smaller heap partition at a time, but lead to lower throughput of applications due to the overhead of executing write barriers.
Problems of the generational garbage collection scheme include:                Sub-optimal throughput of applications due to the overhead of executing write barriers.        The overhead of processing write buffer entries (created as a result of executing write barriers).        The overhead of examining reference fields in objects (to ensure that all references pointing into the region of the heap being collected are found).        The problems associated with premature promotion of young objects that are going to die soon anyway, such as executing more write barriers, dragging dead objects into the old generation, and requiring more major collections.        The overhead of promoting and scanning long-lived objects.        
Therefore a need exists to overcome the problems with the prior art as discussed above, and particularly for a method of reducing write barrier overhead.